function Animal(name) {
  this.name = name;
  this.eat = function () {
    console.log(`${this.name} 正在吃东西`);
  };
}
function Dog(name, breed) {
  // 关键点：调用父类构造函数并绑定当前 this
  Animal.call(this, name);
  this.breed = breed;
}
const myDog = new Dog("旺财", "哈士奇");
myDog.eat(); // 输出: 旺财 正在吃东西
